package homework_04.home_08;

public class HomeWork_08 {
    /*将一个数组中的重复元素保留一个其他的清零。*/
    public static void main(String[] args) {
        int[]a = {1,1,2,5,8,9,6,4,3,2,1,5,8,4,6,32,1,4,5,6,8,7,1,2,3,5,4,56,6};
        quchong(a);
    }
    public static void quchong(int[] a){
        for (int i=0;i<a.length;i++){
            for (int j=i+1;j<a.length;j++){
                if (a[i]==a[j]){
                    a[j]=0;
                }
            }
            System.out.print(a[i]+"  ");
        }
    }
}
